show in red the conversions that are worse than the current BABL_TOLERANCE
authorØyvind Kolås <ok@src.gnome.org>
Sun, 16 Nov 2008 20:35:57 +0000 (20:35 +0000)
committerØyvind Kolås <ok@src.gnome.org>
Sun, 16 Nov 2008 20:35:57 +0000 (20:35 +0000)
* babl/babl-fish-stats.c: (legal_error), (each_conv): show in red the
conversions that are worse than the current BABL_TOLERANCE instead of
the earlier arbitrary 0.01.

svn path=/trunk/; revision=358

ChangeLog
babl/babl-fish-stats.c

index d6ea0b2c3aa173ca2b9df02c56b92af9e3c0d5be..49d41ad25d96ebf59d873110cd5dc615bfa86d24 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-16  Øyvind Kolås  <pippin@gimp.org>
+
+       * babl/babl-fish-stats.c: (legal_error), (each_conv): show in red the
+       conversions that are worse than the current BABL_TOLERANCE instead of
+       the earlier arbitrary 0.01.
+
 2008-11-16  Martin Nordholts  <martinn@svn.gnome.org>
 
        * babl/babl-fish-path.c: Use the default babl tolerance level if
index 9f938c34ffb748fd8bf5448d7dbc716493d14b73..d9fa9ba4c352d3f5dc799bd8e491254d7788faf2 100644 (file)
@@ -202,6 +202,24 @@ table_source_each (Babl *babl,
   return 0;
 }
 
+/* copied from babl-fish-path.c */
+#define BABL_LEGAL_ERROR    0.000001
+static double legal_error (void)
+{
+  static double error = 0.0;
+  const char   *env;
+
+  if (error != 0.0)
+    return error;
+
+  env = getenv ("BABL_TOLERANCE");
+  if (env && env[0] != '\0')
+    error = atof (env);
+  else
+    error = BABL_LEGAL_ERROR;
+  return error;
+}
+
 static int
 each_conv (Babl *babl,
            void *data)
@@ -214,7 +232,7 @@ each_conv (Babl *babl,
   error = babl_conversion_error (&babl->conversion);
   cost  = babl_conversion_cost (&babl->conversion);
 
-  if (error > 0.01)
+  if (error > legal_error ())
     {
       fprintf (output_file, "<dt style='background-color: #fcc;'>%s</dt>", babl->instance.name);
       fprintf (output_file, "<dd style='background-color: #fcc;'>");